import App from './App'
// import store from './store'
import { Request } from '@/util/request/index'
// main.js
import uvUI from '@/uni_modules/uv-ui-tools'

import dayjs from "dayjs";
import i18n from '@/locale/index' 
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
Vue.use(uvUI);
const app = new Vue({
  	store,
  ...App
})
app.$mount()
Request(app)
// #endif

// #ifdef VUE3
import * as Pinia from 'pinia';
import Vuex from "vuex";
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
	// app.use(store);
	app.config.globalProperties.$timeFrom = uni.$uv.timeFormat
	app.config.globalProperties.$dayjs = dayjs
	Request(app);
	app.use(Pinia.createPinia());
	app.use(i18n);   //第二步  注册i18n
  return {
    app,
		Vuex, // 如果 nvue 使用 vuex 的各种map工具方法时，必须 return Vuex
		Pinia // 此处必须将 Pinia 返回
  }
}
// #endif